<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <!--[if lt IE 9]>
    <script type="text/javascript" src="../../../lib/html5shiv.js?rev=@@hash"></script>
    <script type="text/javascript" src="../../../lib/respond.min.js?rev=@@hash"></script>
    <![endif]-->
    <link rel="stylesheet" type="text/css" href="../../../static/h-ui/css/H-ui.min.css"/>
    <link rel="stylesheet" type="text/css" href="../../../static/h-ui.admin/css/H-ui.admin.css"/>
    <link rel="stylesheet" type="text/css" href="../../../lib/Hui-iconfont/1.0.8/iconfont.css"/>
    <link rel="stylesheet" type="text/css" href="../../../static/h-ui.admin/skin/default/skin.css" id="skin"/>
    <link rel="stylesheet" type="text/css" href="../../../static/h-ui.admin/css/style.css"/>
    <link rel="stylesheet" type="text/css" href="../../../ht-css/Project.css"/>
    <!--时间选择器样式-->
    <link rel="stylesheet" type="text/css" href="../../../ht-css/jedate.css" />
    <!--引入分页-->
    <link rel="stylesheet" href="../../../lib/pagination/pagination.css">
    <!--表单验证-->
    <script type="text/javascript" src="../../../lib/Validform/5.3.2/Validform_v5.3.2_min.js?rev=@@hash"></script>
    <link rel="stylesheet" type="text/css" href="../../../lib/Validform/5.3.2/style.css"/>
    <!--[if IE 6]>
    <script type="text/javascript" src="../../../lib/DD_belatedPNG_0.0.8a-min.js?rev=@@hash"></script>
    <script>DD_belatedPNG.fix('*');</script>
    <![endif]-->
    <link rel="stylesheet" type="text/css" href="../../../ht-css/style-q.css"/>
    <title>新增项目</title>
</head>
<body data-id="">
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页  <span class="c-gray en">&gt;</span>对接平台管理 <span class="c-gray en">&gt;</span> 渠道管理 <span class="c-gray en">&gt;</span> 新增项目<a
        class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px"
        href="javascript:location.replace(location.href);" title="刷新"><i class="Hui-iconfont">&#xe68f;</i></a></nav>
<article class="page-container">
    <form class="ml-20 mr-20" id="coupon-add">
        <div>
            <div class="bg-1 bk-gray pd-20 mb-20">
                <div class="va-m lh-20 f-16 pb-15">
                    <strong>我司客户信息</strong>
                </div>
                <div class="line"></div>
                <table class="table-hover mb-10 mt-10 table">
                    <thead class="text-l">
                    <tr>
                        <td class="col-4-1">
                            <div class="row ml-10">
                                <label class="form-label f-l pt-5"><span class="c-red pr-5 f-l">*</span>我司客户ID：</label>
                                <div class="formControls f-l">
                                    <input type="text" style="width:200%" datatype="*" nullmsg="录入必填信息！" errormsg="录入必填信息" class="input-text radius" name="customerId" id="customerId"
                                           disabled="disabled"><span id="message0" class="tip"></span>
                                </div>
                            </div>
                        </td>
                        <td class="col-4-1">
                            <div class="row ml-10">
                                <!--<a class="btn btn-secondary radius size-S ml-10" onclick="chooseProject()">选择</a>-->
                                <input class="btn btn-secondary radius size-S ml-10" onclick="chooseProject()" type="button" value="选择">
                            </div>
                        </td>

                        <td class="col-4-1">
                            <label class="form-label f-l pt-5"></label>
                            <span class="f-l pt-5" name="empty" id="empty"></span>
                        </td>
                        <td class="col-4-1">
                            <label class="form-label f-l pt-5"></label>
                            <span class="f-l pt-5" name="empty1" id="empty1"></span>
                        </td>
                    </tr>
                    <tr>
                        <td class="col-4-1">
                            <div class="row ml-10">
                                <label class="form-label f-l pt-5"><span class="c-red pr-5 f-l">*</span>CRM客户编码：</label>

                                <div class="formControls f-l">
                                    <input type="text" style="width:200%" datatype="*" nullmsg="录入必填信息！" errormsg="录入必填信息"  class="input-text radius" name="customerCode" id="customerCode"
                                           disabled="disabled">

                                </div>

                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td class="col-4-1">
                            <div class="row ml-10">
                                <label class="form-label f-l pt-5"><span class="c-red pr-5 f-l">*</span>客户名称：</label>
                                <div class="formControls f-l">
                                    <input type="text" style="width:200%" datatype="*" nullmsg="录入必填信息！" errormsg="录入必填信息" class="input-text radius" name="customerName" id="customerName"
                                           disabled="disabled"><span id="messageName" class="tip"></span>
                                </div>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td class="col-4-1">
                            <div class="row ml-10">
                                <label class="form-label f-l pt-5"><span class="c-red pr-5 f-l">*</span>客户归属：</label>
                                <div class="formControls f-l">
                                    <input type="text" style="width:200%" datatype="*" nullmsg="录入必填信息！"  errormsg="录入必填信息" class="input-text radius" name="belongGroupName" id="belongGroupName"
                                           disabled="disabled"><span id="messageBelong" class="tip"></span>
                                </div>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td class="col-4-1">
                            <div class="row ml-10">
                                <label class="form-label f-l pt-5"><span class="c-red pr-5 f-l">*</span>主客户设置：</label>
                                <div class="radio-box f-l mt-5">
                                    <input name="mainCustomers" id="shi" type="radio" value="1">
                                    <label  class="">是</label>
                                </div>
                                <div class="radio-box f-l mt-5">
                                    <input name="mainCustomers" id="fou" type="radio" value="0">
                                    <label  class="">否</label>
                                </div>
                            </div>
                        </td>
                    </tr>
                    <!--<tr>
                        <td class="col-4-1">
                            <div class="row ml-10">
                                <label class="form-label f-l pt-5"><span class="c-red pr-5 f-l">*</span>收货客户：</label>
                                <div class="formControls f-l">
                                    <input type="text" style="width:200%"  datatype="*" nullmsg="录入必填信息！" errormsg="录入必填信息" class="input-text radius" name="receiverCompanyName" id="receiverCompanyName"
                                           placeholder="输入收货客户" maxlength="64">
                                </div>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td class="col-4-1">
                            <div class="row ml-10">
                                <label class="form-label f-l pt-5"><span class="c-red pr-5 f-l">*</span>开票客户：</label>
                                <div class="formControls f-l">
                                    <input type="text" style="width:200%" datatype="*" nullmsg="录入必填信息！" errormsg="录入必填信息" class="input-text radius" name="invoiceCompanyName" id="invoiceCompanyName"
                                           placeholder="输入开票客户" maxlength="64"><span id="messageBallot" class="tip"></span>
                                </div>
                            </div>
                        </td>
                    </tr>-->
                    </thead>
                </table>


                <div class="va-m lh-20 f-16 pb-15">
                    <strong>渠道项目信息</strong>
                </div>
                <div class="line"></div>
                <div class="pd-20">
                    <div class="clearfix mb-15">
                        <label class="f-l pt-5"><span class="c-red pr-5 f-l">*</span>对方项目编码：</label>
                        <div class="formControls f-l" style="float:left">
                            <table>
                                <tr>
                                    <td>
                                        <input type="text" style="width:300px"  datatype="*" nullmsg="录入必填信息！" errormsg="不允许输入异常字符！" class="input-text radius" name="projectId" id="projectId"
                                               placeholder="输入对方项目编码" maxlength="64"><span id="messageProject" class="tip"></span>
                                    </td>
                                    <td>
                                        <input id="zjButton" class="btn btn-secondary radius size-S ml-10" onclick="chooseChanelProject()" type="button" value="选择">
                                    </td>
                                </tr>
                            </table>
                        </div>
                    </div>
                    <div class="clearfix mb-15">
                        <label class="f-l pt-5"><span class="c-red pr-5 f-l">*</span>对方项目名称：</label>
                        <div class="formControls col-sm-5">
                            <textarea name="projectName" id="projectName"  datatype="*" nullmsg="录入必填信息！" errormsg="录入必填信息" class="textarea" title="" maxlength="120"></textarea>
                        </div>
                    </div>
                    <div class="clearfix mb-15">
                        <label class="form-label f-l pt-5"><span class="c-red pr-5 f-l">*</span>对方所属分子公司：</label>
                        <div class="formControls f-l">
                            <input type="text"  style="width:200%" datatype="*" nullmsg="录入必填信息！" errormsg="录入必填信息" class="input-text radius" name="projectBelongName" id="projectBelongName"
                                   placeholder="输入对方所属分子公司" maxlength="60"><span id="messageCompany" class="tip"></span>
                        </div>
                    </div>
                    <div class="clearfix mb-15">
                        <label class="form-label f-l pt-5"><span class="c-red pr-5 f-l">&nbsp;</span>联系人：</label>
                        <div class="formControls f-l">
                            <input type="text"  style="width:200%" class="input-text radius" name="contacts" id="contacts"
                                   placeholder="" maxlength="60">
                        </div>
                    </div>
                    <div class="clearfix mb-15">
                        <label class="form-label f-l pt-5"><span class="c-red pr-5 f-l">&nbsp;</span>电话：&nbsp;&nbsp;&nbsp;</label>
                        <div class="formControls f-l">
                            <input type="text"  style="width:200%" class="input-text radius" name="telephone" id="telephone"
                                   placeholder="" maxlength="11"><div id="err-message"></div>
                        </div>
  
                    </div>
                    <div class="clearfix mb-15">
                        <label class="form-label f-l pt-5"><span class="c-red pr-5 f-l">&nbsp;</span>地址：&nbsp;&nbsp;&nbsp;</label>
                        <div class="formControls f-l">
                            <input type="text"  style="width:200%" class="input-text radius" name="address" id="address"
                                   placeholder="" maxlength="60">
                        </div>
                    </div>
                </div>
                <div class="text-c mb-10 ">
                    <input id="bottm" type="submit" class="btn btn-secondary radius size-S"
                           value="保&nbsp;&nbsp;存">
                    <!--<a class="btn btn-secondary radius size-S ml-10" onclick="pircaladd()">保存</a>-->
                    <button class="btn radius size-S" onclick="colse()">取消</button>

                </div>
                <!--<div class="text-c mb-10 ">
                    <input id="bottm" type="submit" class="btn btn-secondary radius size-S"
                           value="确&nbsp;&nbsp;认">
                    &lt;!&ndash;<input id="refresh" type="button" class="btn btn-secondary radius size-S botter"&ndash;&gt;
                    &lt;!&ndash;value="&nbsp;测&nbsp;&nbsp;试&nbsp;" onclick="makeMap()">&ndash;&gt;
                    &lt;!&ndash;<input id="aaa" type="button" class="btn btn-secondary radius size-S botter"&ndash;&gt;
                    &lt;!&ndash;value="&nbsp;检&nbsp;&nbsp;查&nbsp;" onclick="check()">&ndash;&gt;
                </div>-->
            </div>
        </div>
    </form>
</article>
<!--_footer 作为公共模版分离出去-->
<script type="text/javascript" src="../../../lib/jquery/1.9.1/jquery.min.js?rev=@@hash"></script>
<script type="text/javascript" src="../../../lib/layer/2.4/layer.js?rev=@@hash"></script>
<script type="text/javascript" src="../../../static/h-ui/js/H-ui.min.js?rev=@@hash"></script>
<script type="text/javascript" src="../../../static/h-ui.admin/js/H-ui.admin.js?rev=@@hash"></script> <!--/_footer 作为公共模版分离出去-->
<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="../../../lib/My97DatePicker/4.8/WdatePicker.js?rev=@@hash"></script>
<!--表单验证-->
<script type="text/javascript" src="../../../lib/jquery.validation/1.14.0/jquery.validate.js?rev=@@hash"></script>
<script type="text/javascript" src="../../../lib/jquery.validation/1.14.0/validate-methods.js?rev=@@hash"></script>
<script type="text/javascript" src="../../../lib/jquery.validation/1.14.0/messages_zh.js?rev=@@hash"></script>
<script type="text/javascript" src="../../../lib/datatables/1.10.0/jquery.dataTables.min.js?rev=@@hash"></script>
<script type="text/javascript" src="../../../lib/laypage/1.2/laypage.js?rev=@@hash"></script>
<script type="text/javascript" src="../../../lib/Validform/5.3.2/Validform_v5.3.2_min.js?rev=@@hash"></script>
<!--引入分页-->
<link rel="stylesheet" href="../../../lib/pagination/pagination.css">
<script src="../../../lib/pagination/jquery.pagination.js?rev=@@hash"></script>
<script src="../../../ht-js/public.js?rev=@@hash"></script>
<!--验证token-->
<script src="../../../ht-js/verifyToken.js?rev=@@hash"></script>
<script src="../../../ht-js/Customer/Customer.js?rev=@@hash"></script>
<script src="../../../ht-js/dockingplatform/channel/addProject.js?rev=@@hash"></script>
<script src="../../../ht-js/dockingplatform/channel/chooseChannel.js?rev=@@hash"></script>
<script>
    function colse() {
        parent.layer.closeAll();
    }
    var customerId = "";
    var customerCode = "";
    var customerName = "";
    var belongGroupName = "";

    var projectId = "";
    var projectName = "";
    var projectBelongName = "";
    function invioceInit1(){
        $("#customerId").val(customerId);
        $("#customerCode").val(customerCode);
        $("#customerName").val(customerName);
        $("#belongGroupName").val(belongGroupName);
    }

    function invioceInit2(){
        $("#projectId").val(projectId);
        $("#projectName").val(projectName);
        $("#projectBelongName").val(projectBelongName);
    }

    $(function () {
        if (sessionStorage.getItem("customerCode")=="DJ00000007"){
            $("#zjButton").css({
                display: "inline"
            });
        }

        
        $("#coupon-add").Validform({
            tiptype: 1,
            callback: function (form) {
                console.log(1000)
                pircaladd();
                return false;
            }
        });





       /* console.log("llllllll"+sessionStorage.getItem("id"));
        if (localStorage.getItem("choosecustomerId")!=null) {
            $("#customerId").val(localStorage.getItem("choosecustomerId"));
            $("#customerCode").val(localStorage.getItem("choosecustomerCode"));
            $("#customerName").val(localStorage.getItem("choosecustomerName"));
            $("#belongGroupName").val(localStorage.getItem("choosebelongGroupName"));
            localStorage.removeItem("choosecustomerId");
            localStorage.removeItem("choosecustomerCode");
            localStorage.removeItem("choosecustomerName");
            localStorage.removeItem("choosebelongGroupName");
            var chooseData = JSON.parse(localStorage.getItem("chooseData"));
            $("#projectId").val(chooseData.projectId);
            $("#projectName").val(chooseData.projectName);
            $("#projectBelongName").val(chooseData.projectBelongName);
            $("#receiverCompanyName").val(chooseData.receiverCompanyName);
            $("#invoiceCompanyName").val(chooseData.invoiceCompanyName);
            localStorage.removeItem("chooseData")
        }else {
            var editdata = JSON.parse(sessionStorage.getItem("editdata"));
            $("#customerId").val(editdata.customerId);
            $("#customerCode").val(editdata.customerCode);
            $("#customerName").val(editdata.customerName);
            $("#projectId").val(editdata.projectId);
            $("#projectName").val(editdata.projectName);
            $("#projectBelongName").val(editdata.projectBelongName);
            $("#receiverCompanyName").val(editdata.receiverCompanyName);
            $("#invoiceCompanyName").val(editdata.invoiceCompanyName);
            $("#belongGroupName").val(editdata.belongGroupName);
            sessionStorage.removeItem("editdata")
        }*/
        console.log(JSON.parse(sessionStorage.getItem("editdata")))
        if (JSON.parse(sessionStorage.getItem("editdata") != null))
        {
            var editdata = JSON.parse(sessionStorage.getItem("editdata"));
            $("#customerId").val(editdata.customerId);
            $("#customerCode").val(editdata.customerCode);
            $("#customerName").val(editdata.customerName);
            $("#projectId").val(editdata.projectId);
            $("#projectName").val(editdata.projectName);
            $("#projectBelongName").val(editdata.projectBelongName);
            $("#receiverCompanyName").val(editdata.receiverCompanyName);
            $("#invoiceCompanyName").val(editdata.invoiceCompanyName);
            $("#belongGroupName").val(editdata.belongGroupName);
            /* 联系人，电话，住址是否为null的判断 */
            if(editdata.contacts == 'null' || editdata.contacts == 'undefined') $('#contacts').val();
            else $('#contacts').val(editdata.contacts);
            if(editdata.telephone == 'null' || editdata.telephone == 'undefined') $('#telephone').val();
            else $('#telephone').val(editdata.telephone);
            if(editdata.address == 'null' || editdata.address == 'undefined') $('#address').val();
            else $('#address').val(editdata.address);
            if (editdata.mainCustomers==1){
                //是
                $("#shi").attr("checked","checked");
            }else{
                //否
                $("#fou").attr("checked","checked");
            }
            sessionStorage.removeItem("editdata")
        }


    });
    /*channelDetails()*/
    /*function channelDetails() {
        $.ajax({
            url:root.dockingplatform.getChannelConfigById,
            cache: false,  //禁用缓存
            type: "POST",
            dataType:'json',
            contentType: "application/json",
            data: JSON.stringify({
                "id":sessionStorage.getItem("id"),
            }),
            success: function (data) {
                console.log(data)
                $("#customerId").html(data.data.customerId)
                $("#customerName").html(data.data.customerName)
                $("#customerBelong").html(data.data.customerBelong)
                $("#interfaceType").val(data.data.interfaceType)
                $("#customerStatus").val(data.data.customerStatus)
                $("#customerPlatform").val(data.data.customerPlatform)
                $("#description").val(data.data.description)
            },
            error: function () {
                $.Huimodalalert('失败！',2000);
            }
        });
    }*/



</script>
</body>
</html>